package com.ss.android.article.base.feature.detail.model;

import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import com.ss.android.account.model.SpipeUser;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.feed.c.FeedDownloadAppAd;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.article.base.feature.model.DownloadAppAd;
import com.ss.android.article.base.feature.model.MediaInfo;
import com.ss.android.article.base.feature.model.RelatedVideoTouTiao;
import com.ss.android.article.base.feature.model.RelatedWenda;
import com.ss.android.article.base.feature.model.VideoAlbumInfo;
import com.ss.android.article.base.feature.update.a.UserInfo;
import com.ss.android.article.base.feature.video.ThirdVideoPartnerData;
import com.ss.android.b.a.BaseAdsData;
import com.ss.android.common.AbsApiThread;
import com.ss.android.common.util.json.JsonUtil;
import com.ss.android.image.model.ImageInfo;
import com.ss.android.newmedia.a.AdsAppBaseActivity;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

public final class ArticleInfo {
    public final long itemId;
    public final long groupItemId;
    public final List relatedNewsList;
    public final List relatedGalleryList;
    public final List j;
    public final List videoSubjectList;
    public final List<RelatedVideoTouTiao> relatedVideoToutiaoList;
    public ImageAdsData A;
    public TaoBaoSdkAdsData B;
    public DownloadAppAd mDownloadAppAd;
    public ImageTitleBar D;
    public MediaAdsData E;
    public ImageRecom F;
    public JSONObject imageRecom;
    public String relatedVideoOpenPageUrl;
    public long relatedVideoGroupId;
    public long relatedVideoItemId;
    public int relatedVideoAggrType;
    public String relatedVideoOuterSchema;
    public String relatedVideoTitle;
    public ImageInfo relatedVideoImageInfo;
    public String webViewTrackKey;
    public MediaInfo mMediaInfo;
    public int videoWatchCount;
    public String landingPageUrl;
    public String videoLabelHtml;
    public ThirdVideoPartnerData mThirdVideoPartnerData;
    public WendaData wendaData;
    public String etag;
    public WendaNextPage mWendaNextPage;
    public LinkedHashMap X;
    public b Y;
    public List<RelatedNewsItem> Z;
    public a aa;
    public AdVideoInfo adVideoInfo;
    public FeedDownloadAppAd feedDownloadAppAd;
    public int articlePosition;
    public int ae;
    public VideoExtendLink videoExtendLink;
    public String context;
    public long d;
    public boolean banComment;
    public boolean delete;
    public String script;
    public JSONArray relatedSlides;
    public int relatedVideoSection;
    public boolean userDigg;
    public boolean userBury;
    public int diggCount;
    public int buryCount;
    public String alertText;
    public String shareUrl;
    public String displayUrl;
    public String displayTitle;
    public WebInfo mWebInfo;
    public BannerAdsData mBannerAdsData;
    public MixedAdsData y;
    public PhoneAdsData z;
    private List ag;
    private List labelList;
    private int repinUserCount;
    private List repinUserList;

    private ArticleInfo(long arg6, long arg8) {
        this.banComment = false;
        this.delete = false;
        this.relatedNewsList = new ArrayList();
        this.ag = new ArrayList();
        this.relatedGalleryList = new ArrayList();
        this.j = new ArrayList();
        this.videoSubjectList = new ArrayList();
        this.relatedVideoToutiaoList = new ArrayList();
        this.relatedSlides = null;
        this.relatedVideoSection = 0;
        this.labelList = new ArrayList();
        this.repinUserCount = 0;
        this.repinUserList = new ArrayList();
        this.diggCount = -1;
        this.buryCount = -1;
        this.alertText = null;
        this.shareUrl = null;
        this.displayUrl = null;
        this.displayTitle = null;
        this.mWebInfo = null;
        this.mBannerAdsData = null;
        this.y = null;
        this.z = null;
        this.A = null;
        this.B = null;
        this.mDownloadAppAd = null;
        this.D = null;
        this.E = null;
        this.F = null;
        this.webViewTrackKey = null;
        this.X = new LinkedHashMap();
        this.ae = 100;
        this.itemId = arg6;
        this.groupItemId = arg8;
        this.ae = 100;
    }

    public ArticleInfo(long arg2, long arg4, byte arg6) {
        this(arg2, arg4);
    }

    private void parseAdInfo(JSONObject jsonObject) {
        if (jsonObject != null) {
            this.aa = new a();
            JSONObject bannerJO = jsonObject.optJSONObject("banner");
            if (bannerJO != null) {
                this.aa.mBannerAdsData = new BannerAdsData();
                this.aa.mBannerAdsData.initWithJO(bannerJO);
                if (this.aa.mBannerAdsData.isValid()) {
                    this.mBannerAdsData = this.aa.mBannerAdsData;
                }
            }

            JSONObject imageJO = jsonObject.optJSONObject("image");
            if (imageJO != null) {
                this.aa.d = new ImageAdsData();
                this.aa.d.initWithJO(imageJO);
                if (this.aa.d.isValid()) {
                    this.A = this.aa.d;
                }
            }

            JSONObject taobaoSdkJo = jsonObject.optJSONObject("taobaosdk");
            if (taobaoSdkJo != null && (AppData.getInstance().isTaoBaoSdkEnable())) {
                this.aa.e = new TaoBaoSdkAdsData();
                this.aa.e.initWithJO(taobaoSdkJo);
                if (this.aa.e.isValid()) {
                    this.B = this.aa.e;
                }
            }

            JSONObject appJo = jsonObject.optJSONObject("app");
            if (appJo != null) {
                this.aa.f = new DownloadAppAd(1);
                this.aa.f.initWithJO(appJo);
                if (this.aa.f.isValid()) {
                    this.mDownloadAppAd = this.aa.f;
                }
            }

            JSONObject mixedJO = jsonObject.optJSONObject("mixed");
            if (mixedJO != null) {
                this.aa.a = new MixedAdsData();
                this.aa.a.initWithJO(mixedJO);
                if (this.aa.a.isValid()) {
                    this.y = this.aa.a;
                }
            }

            JSONObject phoneJO = jsonObject.optJSONObject("phone");
            if (phoneJO != null) {
                this.aa.b = new PhoneAdsData();
                this.aa.b.initWithJO(phoneJO);
                if (this.aa.b.isValid()) {
                    this.z = this.aa.b;
                }
            }

            JSONObject mediaJO = jsonObject.optJSONObject("media");
            if (mediaJO != null) {
                this.aa.g = new MediaAdsData();
                this.aa.g.initWithJO(mediaJO);
                if (this.aa.g.isValid()) {
                    this.E = this.aa.g;
                }
            }

            JSONObject imageTitleBarJO = jsonObject.optJSONObject("image_titlebar");
            if (imageTitleBarJO != null) {
                this.aa.h = new ImageTitleBar();
                this.aa.h.initWithJO(imageTitleBarJO);
                if (this.aa.h.isValid()) {
                    this.D = this.aa.h;
                }
            }

            JSONObject imageRecomJO = jsonObject.optJSONObject("image_recom");
            if (imageRecomJO == null) {
                return;
            }

            JSONObject imageJO2 = imageRecomJO.optJSONObject("image");
            if (imageJO2 != null) {
                this.imageRecom = imageJO2;
            }

            this.aa.i = new ImageRecom();
            this.aa.i.initWithJO(imageJO2);
            if (!this.aa.i.isValid()) {
                return;
            }

            this.F = this.aa.i;
        }
    }

    public final void a(JSONObject jo, boolean arg14) {
        try {
            this.d = System.currentTimeMillis();
            this.webViewTrackKey = jo.optString("webview_track_key");
            this.context = jo.optString("context");
            this.landingPageUrl = jo.optString("landing_page_url");
            this.script = jo.optString("script");
            JSONObject partnerVideoJo = jo.optJSONObject("partner_video");
            if (partnerVideoJo != null) {
                ThirdVideoPartnerData thirdVideoPartnerData = new ThirdVideoPartnerData();
                thirdVideoPartnerData.extractFields(partnerVideoJo);
                this.mThirdVideoPartnerData = thirdVideoPartnerData;
            }
            this.banComment = jo.optInt("ban_comment") > 0;
            this.delete = jo.optInt("delete") > 0;
            AbsApiThread.optBoolean(jo, "is_activity", false);
            jo.optInt("flags");
            this.articlePosition = jo.optInt("article_position");
            JSONArray orderedInfo = jo.optJSONArray("ordered_info");
            int v0_3;
            String v5;
            if (orderedInfo != null) {
                int length = orderedInfo.length();
                for (int i = 0; i < length; ++i) {
                    JSONObject orderedInfoJO = orderedInfo.optJSONObject(i);
                    String name = orderedInfoJO.optString("name");
                    v0_3 = -1;
                    switch (name.hashCode()) {
                        case -1110417409: {
                            if (name.equals("labels")) {
                                v0_3 = 0;
                            } else {
                            }

                            break;
                        }
                        case -158268061: {
                            if (name.equals("admin_debug")) {
                                v0_3 = 4;
                            } else {
                            }

                            break;
                        }
                        case 3107: {
                            if (name.equals("ad")) {
                                v0_3 = 1;
                            } else {
                            }

                            break;
                        }
                        case 154176103: {
                            if (name.equals("related_news")) {
                                v0_3 = 3;
                            } else {
                            }

                            break;
                        }
                        case 2079675412: {
                            if (name.equals("like_and_rewards")) {
                                v0_3 = 2;
                            } else {
                            }

                            break;
                        }
                    }

                    JSONObject v8;
                    int v7;
                    ArrayList v6;
                    JSONArray v4_1;
                    switch (v0_3) {
                        case 0: {
                            v4_1 = orderedInfoJO.optJSONArray("data");
                            if (v4_1 != null) {
                                v6 = new ArrayList();
                                v0_3 = 0;
                                v7 = v4_1.length();
                                while (v0_3 < v7) {
                                    v8 = v4_1.optJSONObject(v0_3);
                                    d v9 = new d();
                                    v9.a = v8.optString("word");
                                    v9.b = AdsAppBaseActivity.b(v8.optString("link"));
                                    ((List) v6).add(v9);
                                    ++v0_3;
                                }

                                this.X.put(name, v6);
                            } else {
                            }

                            break;
                        }
                        case 1: {
                            partnerVideoJo = orderedInfoJO.optJSONObject("data");
                            if (partnerVideoJo == null) {
                                continue;
                            }

                            this.parseAdInfo(partnerVideoJo);
                            this.X.put(name, this.aa);
                            break;
                        }
                        case 2: {
                            orderedInfoJO = orderedInfoJO.optJSONObject("data");
                            if (orderedInfoJO != null) {
                                b v6_1 = new b();
                                v6_1.likeNum = orderedInfoJO.optInt("like_num");
                                v6_1.userLike = orderedInfoJO.optInt("user_like") != 0;
                                orderedInfoJO.optInt("rewards_num");
                                AdsAppBaseActivity.b(orderedInfoJO.optString("rewards_open_url"));
                                AdsAppBaseActivity.b(orderedInfoJO.optString("rewards_list_url"));
                                v6_1.c = new ArrayList();
                                v6_1.d = new ArrayList();
                                v4_1 = orderedInfoJO.optJSONArray("rewards_list");
                                if (v4_1 != null) {
                                    v0_3 = 0;
                                    v7 = v4_1.length();
                                    while (v0_3 < v7) {
                                        v8 = v4_1.optJSONObject(v0_3);
                                        if (v8 != null) {
                                            UserInfo v9_1 = UserInfo.fromJO(v8, true);
                                            if (v9_1 != null) {
                                                v6_1.d.add(v9_1);
                                            }

                                            v6_1.c.add(Uri.parse(v8.optString("avatar_url")));
                                        }

                                        ++v0_3;
                                    }
                                }

                                this.X.put(name, v6_1);
                                this.Y = v6_1;
                            } else {
                            }

                            break;
                        }
                        case 3: {
                            v4_1 = orderedInfoJO.optJSONArray("data");
                            if (v4_1 == null) {
                                continue;
                            }

                            v6 = new ArrayList();
                            v0_3 = 0;
                            v7 = v4_1.length();
                            while (v0_3 < v7) {
                                v8 = v4_1.optJSONObject(v0_3);
                                if (v8 != null) {
                                    RelatedNewsItem v9_2 = new RelatedNewsItem();
                                    v9_2.a = v8.optString("title");
                                    v9_2.e = AdsAppBaseActivity.b(v8.optString("open_page_url"));
                                    v9_2.b = v8.optString("type_name");
                                    v9_2.c = v8.optString("type_color");
                                    v9_2.d = v8.optString("type_color_night");
                                    v9_2.f = v8.optLong("group_id");
                                    v8.optLong("item_id");
                                    v8.optInt("aggr_type");
                                    v9_2.g = v8.optString("impr_id");
                                    ((List) v6).add(v9_2);
                                }
                                ++v0_3;
                            }

                            this.Z = ((List) v6);
                            this.X.put(name, v6);
                            break;
                        }
                        case 4: {
                            partnerVideoJo = orderedInfoJO.optJSONObject("data");
                            if (partnerVideoJo != null) {
                                this.mWebInfo = new WebInfo();
                                this.mWebInfo.parseJSONObject(partnerVideoJo);
                            }

                            this.X.put(name, this.mWebInfo);
                            break;
                        }
                    }

                    continue;
                }
            }

            JSONArray relatedWendaJA = jo.optJSONArray("related_wenda");
            if (relatedWendaJA != null) {
                int length = relatedWendaJA.length();
                for (int i = 0; i < length; ++i) {
                    JSONObject relatedWendaJO = relatedWendaJA.getJSONObject(i);
                    if (relatedWendaJO != null) {
                        RelatedWenda relatedWenda = new RelatedWenda();
                        if (relatedWendaJO != null) {
                            relatedWenda.answerId = relatedWendaJO.optLong("answer_id");
                            relatedWenda.questionId = relatedWendaJO.optLong("question_id");
                            relatedWendaJO.optString("read_count");
                            relatedWendaJO.optString("reply_count");
                            relatedWenda.title = relatedWendaJO.optString("title");
                            relatedWendaJO.optLong("answer_user_id");
                            relatedWendaJO.optString("answer_user_name");
                            relatedWenda.answerAbstract = relatedWendaJO.optString("answer_abstract");
                            relatedWendaJO.optString("answer_open_url");
                            relatedWendaJO.optString("question_open_url");
                            relatedWendaJO.optString("answer_user_profile_image_url");
                        }

                        boolean valid = relatedWenda.answerId > 0
                                && relatedWenda.questionId > 0
                                && (!android.support.design.a.isTextEmpty(relatedWenda.title))
                                && (!android.support.design.a.isTextEmpty(relatedWenda.answerAbstract));
                        if (valid) {
                            this.j.add(relatedWenda);
                        }
                    }
                }
            }

            JSONArray relatedNewsJA = jo.optJSONArray("related_news");

            JSONObject jsonObject;
            int v8_1;
            long v2_1;
            if (relatedNewsJA != null) {
                int length = relatedNewsJA.length();
                for (int i = 0; i < length; ++i) {
                    JSONObject relatedNewsJO = relatedNewsJA.getJSONObject(i);
                    long groupId = relatedNewsJO.optLong("group_id");
                    if (groupId > 0) {
                        Article article = new Article(groupId, relatedNewsJO.optLong("item_id"), relatedNewsJO.optInt("aggr_type"));
                        JsonUtil.parseJSONObject(relatedNewsJO, article);
                        this.relatedNewsList.add(article);
                    }
                }
            }

            JSONArray relatedGalleryJA = jo.optJSONArray("related_gallery");
            if (relatedGalleryJA != null) {
                this.relatedSlides = relatedGalleryJA;
                int length = relatedGalleryJA.length();
                for (int i = 0; i < length; ++i) {
                    JSONObject relatedGalleryJO = relatedGalleryJA.getJSONObject(i);
                    long groupId = relatedGalleryJO.optLong("group_id");
                    if (groupId > 0) {
                        Article gallery = new Article(groupId, relatedGalleryJO.optLong("item_id"), relatedGalleryJO.optInt("aggr_type"));
                        JsonUtil.parseJSONObject(relatedGalleryJO, gallery);
                        this.relatedGalleryList.add(gallery);
                    }
                }
            }

            long v4_3;
            String v1_4;
            int v9_4;
            if (arg14) {
                JSONArray relatedVideoToutiaoJA = jo.optJSONArray("related_video_toutiao");
                if (relatedVideoToutiaoJA != null) {
                    int length = relatedVideoToutiaoJA.length();
                    for (int i = 0; i < length; i++) {
                        JSONObject relatedVideoToutiaoJO = relatedVideoToutiaoJA.getJSONObject(i);
                        String logExtra = relatedVideoToutiaoJO.optString("log_extra", null);
                        String cardType = relatedVideoToutiaoJO.optString("card_type");
                        if (android.support.design.a.isTextEquals(cardType, "video_subject")
                                || android.support.design.a.isTextEquals(cardType, "album")) {
                            RelatedVideoTouTiao relatedVideoTouTiao = new RelatedVideoTouTiao(1);
                            relatedVideoTouTiao.videoAlbumInfo = new VideoAlbumInfo();
                            relatedVideoTouTiao.videoAlbumInfo.initWithJSONObject(relatedVideoToutiaoJO);
                            relatedVideoTouTiao.logExtra = logExtra;
                            this.relatedVideoToutiaoList.add(relatedVideoTouTiao);
                        } else if (android.support.design.a.isTextEquals(cardType, "ad_textlink")) {
                            RelatedVideoTouTiao relatedVideoTouTiao = new RelatedVideoTouTiao(3);
                            relatedVideoTouTiao.showTag = relatedVideoToutiaoJO.optString("show_tag");
                            relatedVideoTouTiao.logExtra = logExtra;
                            try {
                                relatedVideoTouTiao.article = new Article(0, 0, 0);
                                JsonUtil.parseJSONObject(relatedVideoToutiaoJO, relatedVideoTouTiao.article);
                                relatedVideoTouTiao.baseAdsData = new BaseAdsData();
                                relatedVideoTouTiao.baseAdsData.initWithJO(relatedVideoToutiaoJO);
                            } catch (Exception exception) {
                            }

                            if (relatedVideoTouTiao.article == null) {
                            } else if (relatedVideoTouTiao.article.middleImage == null) {
                            } else if (TextUtils.isEmpty(relatedVideoTouTiao.article.source)) {
                            } else if (TextUtils.isEmpty(relatedVideoTouTiao.article.title)) {
                            } else if (relatedVideoTouTiao.baseAdsData == null) {
                            } else if (relatedVideoTouTiao.baseAdsData.id <= 0) {
                            } else if (!TextUtils.isEmpty(relatedVideoTouTiao.baseAdsData.webUrl)) {
                                this.relatedVideoToutiaoList.add(relatedVideoTouTiao);
                            }
                        } else {
                            long groupId = relatedVideoToutiaoJO.optLong("group_id");
                            if (groupId > 0) {
                                long itemId = relatedVideoToutiaoJO.optLong("item_id");
                                int aggrType = relatedVideoToutiaoJO.optInt("aggr_type");
                                RelatedVideoTouTiao relatedVideoTouTiao = android.support.design.a.isTextEquals(cardType, "video")
                                        ? new RelatedVideoTouTiao(0)
                                        : new RelatedVideoTouTiao(2);
                                relatedVideoTouTiao.article = new Article(groupId, itemId, aggrType);
                                JsonUtil.parseJSONObject(relatedVideoToutiaoJO, relatedVideoTouTiao.article);
                                relatedVideoTouTiao.showTag = relatedVideoToutiaoJO.optString("show_tag");
                                relatedVideoTouTiao.logExtra = logExtra;
                                this.relatedVideoToutiaoList.add(relatedVideoTouTiao);
                            }
                        }
                    }
                }
            } else {
                JSONArray relatedVideoToutiaoJA = jo.optJSONArray("related_video_toutiao");
                if (relatedVideoToutiaoJA != null) {
                    int length = relatedVideoToutiaoJA.length();
                    for (int i = 0; i < length; i++) {
                        JSONObject relatedVideoToutiaoJo = relatedVideoToutiaoJA.getJSONObject(i);
                        long groupId = relatedVideoToutiaoJo.optLong("group_id");
                        if (groupId > 0) {
                            Article article = new Article(groupId,
                                    relatedVideoToutiaoJo.optLong("item_id"),
                                    relatedVideoToutiaoJo.optInt("aggr_type"));
                            JsonUtil.parseJSONObject(relatedVideoToutiaoJo, article);
                            this.ag.add(article);
                        }
                    }
                }
                JSONArray videoSubjectJA = jo.optJSONArray("video_subject");
                if (videoSubjectJA != null) {
                    for (int i = 0; i < videoSubjectJA.length(); ++i) {
                        JSONObject videoSubjectJO = videoSubjectJA.getJSONObject(i);
                        VideoAlbumInfo videoAlbumInfo = new VideoAlbumInfo();
                        videoAlbumInfo.initWithJSONObject(videoSubjectJO);
                        this.videoSubjectList.add(videoAlbumInfo);
                    }
                }

                JSONObject albumJO = jo.optJSONObject("album");
                if (albumJO != null) {
                    VideoAlbumInfo videoAlbumInfo = new VideoAlbumInfo();
                    videoAlbumInfo.initWithJSONObject(albumJO);
                    this.videoSubjectList.add(videoAlbumInfo);
                }
            }
            this.relatedVideoSection = jo.optInt("related_video_section", 0);
            JSONObject relatedVideoJO = jo.optJSONObject("related_video");
            if (relatedVideoJO != null) {
                this.relatedVideoOpenPageUrl = relatedVideoJO.optString("open_page_url");
                this.relatedVideoTitle = relatedVideoJO.optString("title");
                relatedVideoJO.optBoolean("show_video_icon");
                this.relatedVideoOuterSchema = relatedVideoJO.optString("outer_schema");
                this.relatedVideoGroupId = relatedVideoJO.optLong("group_id");
                this.relatedVideoItemId = relatedVideoJO.optLong("item_id");
                this.relatedVideoAggrType = relatedVideoJO.optInt("aggr_type");
                relatedVideoJO.optString("section_title");
                relatedVideoJO = relatedVideoJO.optJSONObject("large_image");
                if (relatedVideoJO != null) {
                    this.relatedVideoImageInfo = ImageInfo.fromJson(relatedVideoJO, true);
                }
            }

            this.repinUserCount = jo.optInt("repin_user_count", 0);
            JSONArray repinUsersJA = jo.optJSONArray("repin_users");
            JSONObject v3_2;
            int v2_3;
            if (repinUsersJA != null) {
                int length = repinUsersJA.length();
                for (int i = 0; i < length; ++i) {
                    JSONObject repinUserJO = repinUsersJA.getJSONObject(i);
                    long repinUserId = repinUserJO.getLong("user_id");
                    if (repinUserId > 0) {
                        SpipeUser spipeUser = new SpipeUser(repinUserId);
                        spipeUser.mAvatarUrl = repinUserJO.optString("avatar_url");
                        this.repinUserList.add(spipeUser);
                    }

                    if (this.repinUserList.size() >= 5) {
                        break;
                    }
                }
            }

            if (this.repinUserCount < this.repinUserList.size()) {
                this.repinUserCount = this.repinUserList.size();
            }

            JSONArray labelJA = jo.optJSONArray("label_list");
            String v4_4;
            if (labelJA != null) {
                int length = labelJA.length();
                for (int i = 0; i < length; ++i) {
                    JSONObject labelJO = labelJA.getJSONObject(i);
                    String name = labelJO.getString("name");
                    String label = labelJO.getString("label");
                    if (!android.support.design.a.isTextEmpty(name) && !android.support.design.a.isTextEmpty(label)) {
                        this.labelList.add(new LabelInfo());
                    }
                }
            }

            this.userDigg = AbsApiThread.optBoolean(jo, "user_digg", false);
            this.userBury = AbsApiThread.optBoolean(jo, "user_bury", false);
            if (this.userDigg) {
                this.userBury = false;
            }

            this.diggCount = jo.optInt("digg_count", -1);
            this.buryCount = jo.optInt("bury_count", -1);
            jo.optInt("repin_count", -1);
            jo.optInt("comment_count", -1);
            AbsApiThread.optBoolean(jo, "user_like", false);
            jo.optInt("like_count", -1);
            jo.optString("like_desc", null);
            this.alertText = jo.optString("alert_text", null);
            jo.optInt("info_flag", 0);
            this.shareUrl = jo.optString("share_url", null);
            this.displayUrl = jo.optString("display_url", null);
            this.displayTitle = jo.optString("display_title", null);
            jo.optString("action_desc", null);
            jo.optJSONObject("log_pb");
            relatedVideoJO = jo.optJSONObject("link");
            if (relatedVideoJO != null) {
                relatedVideoJO.optString("text");
                relatedVideoJO.optString("url");
            }

            JSONObject adJO = jo.optJSONObject("ad");
            if (!arg14 && adJO != null) {
                this.parseAdInfo(adJO);
            }

            JSONObject adminDebugJO = jo.optJSONObject("admin_debug");
            if (adminDebugJO != null) {
                this.mWebInfo = new WebInfo();
                this.mWebInfo.parseJSONObject(adminDebugJO);
            }

            JSONObject forumLinkJO = jo.optJSONObject("forum_link");
            if (forumLinkJO != null) {
                String forumLinkUrl = forumLinkJO.optString("url");
                String forumLinkText = forumLinkJO.optString("text");
                if (!android.support.design.a.isTextEmpty(forumLinkUrl)) {
                    android.support.design.a.isTextEmpty(forumLinkText);
                }
            }

            this.mMediaInfo = MediaInfo.fromJO(jo.optJSONObject("media_info"));
            jo.optInt("is_wenda");
            this.etag = jo.optString("etag");
            this.mWendaNextPage = WendaNextPage.extract(jo.optJSONObject("next_item_struct"));
            JSONObject wendaDataJO = jo.optJSONObject("wenda_data");
            if (this.mWendaNextPage != null) {
                wendaDataJO.put(this.mWendaNextPage.all_answer_text, this.mWendaNextPage.all_answer_text);
                wendaDataJO.put(this.mWendaNextPage.next_answer_schema, this.mWendaNextPage.next_answer_schema);
                wendaDataJO.put(this.mWendaNextPage.next_answer_text, this.mWendaNextPage.next_answer_text);
                wendaDataJO.put("has_next", this.mWendaNextPage.has_next);
            }

            WendaData wendaData = null;
            if (wendaDataJO != null) {
                wendaData = new WendaData();
                wendaData.json = wendaDataJO.toString();
                wendaDataJO.optString("next_answer_schema");
                wendaDataJO.optString("all_answer_text");
                wendaDataJO.optString("next_answer_text");
                wendaDataJO.optBoolean("has_next");
                wendaData.ansid = wendaDataJO.optString("ansid");
                wendaDataJO.optInt("ans_count");
                wendaData.diggCount = wendaDataJO.optInt("digg_count");
                wendaDataJO.optInt("brow_count");
                wendaData.isBanComment = wendaDataJO.optInt("is_ban_comment") > 0;
                wendaDataJO.optInt("is_concern_user");
                wendaDataJO.optInt("is_digg");
                wendaData.isAnswerDelete = wendaDataJO.optInt("is_answer_delete") > 0;
                wendaDataJO.optInt("is_question_delete");
                if (wendaDataJO.has("perm")) {
                    JSONObject permJO = wendaDataJO.optJSONObject("perm");
                    wendaData.canBanComment = permJO.optInt("can_ban_comment") > 0;
                    wendaData.canDeleteAnswer = permJO.optInt("can_delete_answer") > 0;
                    wendaData.canDeleteComment = permJO.optInt("can_delete_comment") > 0;
                    permJO.optInt("can_post_answer");
                    permJO.optInt("can_comment_answer");
                    permJO.optInt("can_digg_answer");
                }
            }
            this.wendaData = wendaData;
            this.videoWatchCount = jo.optInt("video_watch_count");
            this.videoLabelHtml = jo.optString("video_label_html");
            JSONObject adVideoInfoJo = jo.optJSONObject("ad_video_info");
            if (adVideoInfoJo != null) {
                this.adVideoInfo = new AdVideoInfo();
                if (adVideoInfoJo != null) {
                    this.adVideoInfo.name = adVideoInfoJo.optString("name");
                    this.adVideoInfo.desc = adVideoInfoJo.optString("desc");
                    this.adVideoInfo.iconUrl = adVideoInfoJo.optString("icon_url");
                    this.adVideoInfo.url = adVideoInfoJo.optString("url");
                }
            } else {
                this.adVideoInfo = null;
            }

            JSONObject adButtonJo = jo.optJSONObject("ad_button");
            if (adButtonJo != null) {
                this.feedDownloadAppAd = new FeedDownloadAppAd();
                this.feedDownloadAppAd.initWithJO(adButtonJo);
            } else {
                this.feedDownloadAppAd = null;
            }

            if (jo == null) {
                return;
            }

            JSONObject videoExtendLinkJO = jo.optJSONObject("video_extend_link");
            if (videoExtendLinkJO == null) {
                return;
            }
            long videoExtendLinkId = videoExtendLinkJO.optLong("id");
            String videoExtendLinkUrl = videoExtendLinkJO.optString("url");
            String videoExtendLinkButtonText = videoExtendLinkJO.optString("button_text");
            String videoExtendLinkWapTitle = videoExtendLinkJO.optString("wap_title");
            int videoExtendLinkOpenDirect = videoExtendLinkJO.optInt("open_direct");
            int videoExtendLinkIsDownloadApp = videoExtendLinkJO.optInt("is_download_app");
            int videoExtendLinkOpenNewPage = videoExtendLinkJO.optInt("open_new_page");
            String videoExtendLinkPackageName = videoExtendLinkJO.optString("package_name");
            boolean openDirect = videoExtendLinkOpenDirect == 1;
            boolean isDownloadApp = videoExtendLinkIsDownloadApp == 1;
            boolean openNewPage = videoExtendLinkOpenNewPage == 1;
            this.videoExtendLink = new VideoExtendLink(videoExtendLinkId, videoExtendLinkUrl, videoExtendLinkButtonText, videoExtendLinkWapTitle, videoExtendLinkPackageName, openDirect, isDownloadApp, openNewPage);
        } catch (JSONException jsonException) {
            return;
        }
    }

    public final void setUserLike(boolean userLike) {
        if (this.Y != null) {
            this.Y.userLike = userLike;
        }
    }

    public final boolean isUserLike() {
        return this.Y != null && this.Y.userLike;
    }

    public final void increaseUserLikeNum() {
        if (this.Y != null) {
            ++this.Y.likeNum;
        }
    }

    public static class VideoExtendLink implements Parcelable {
        public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {

            public final Object createFromParcel(Parcel arg2) {
                return new ArticleInfo.VideoExtendLink(arg2);
            }

            public final Object[] newArray(int arg2) {
                return new ArticleInfo.VideoExtendLink[arg2];
            }
        };
        public final long id;
        public final boolean isDownloadApp;
        public final String name;
        public final boolean openDirect;
        public final boolean openNewPage;
        public final String packageName;
        public final String url;
        public final String wapTitle;


        VideoExtendLink(long id, String arg4, String arg5, String arg6, String arg7, boolean arg8, boolean arg9, boolean arg10) {
            this.id = id;
            this.url = arg4;
            this.name = arg5;
            this.wapTitle = arg6;
            this.packageName = arg7;
            this.openDirect = arg8;
            this.isDownloadApp = arg9;
            this.openNewPage = arg10;
        }

        protected VideoExtendLink(Parcel parcel) {
            this.id = parcel.readLong();
            this.url = parcel.readString();
            this.name = parcel.readString();
            this.wapTitle = parcel.readString();
            this.packageName = parcel.readString();
            this.openDirect = parcel.readByte() != 0;
            this.isDownloadApp = parcel.readByte() != 0;
            this.openNewPage = parcel.readByte() == 1;
        }

        public int describeContents() {
            return 0;
        }

        public void writeToParcel(Parcel parcel, int i) {
            int v1 = 1;
            parcel.writeLong(this.id);
            parcel.writeString(this.url);
            parcel.writeString(this.name);
            parcel.writeString(this.wapTitle);
            parcel.writeString(this.packageName);
            int v0 = this.openDirect ? 1 : 0;
            parcel.writeByte(((byte) v0));
            v0 = this.isDownloadApp ? 1 : 0;
            parcel.writeByte(((byte) v0));
            if (!this.openNewPage) {
                v1 = 0;
            }

            parcel.writeByte(((byte) v1));
        }
    }

    public final class a {
        public MixedAdsData a;
        public PhoneAdsData b;
        public BannerAdsData mBannerAdsData;
        public ImageAdsData d;
        public TaoBaoSdkAdsData e;
        public DownloadAppAd f;
        public MediaAdsData g;
        public ImageTitleBar h;
        public ImageRecom i;

        public a() {

        }
    }

    public final class b {
        public int likeNum;
        public boolean userLike;
        public List c;
        public List d;

        public b() {

        }
    }

    public final class RelatedNewsItem {
        public String a;
        public String b;
        public String c;
        public String d;
        public String e;
        public long f;
        public String g;

        public RelatedNewsItem() {

        }
    }

    public final class d {
        public String a;
        public String b;

        public d() {

        }
    }
}

